﻿namespace GreenIsomer.Data.Entities.Transform {
	using System;
	using System.Xml.Serialization;

	[Serializable, XmlType("CsdlOutput", Namespace = Settings.Namespace)]
	public class CsdlOutput : Output {

		public CsdlOutput() { }

		public override string TypeDescription {
			get { return "ADO.NET Conceptual Models Metadata"; }
		}

		public override string TypeName {
			get { return "CSDL"; }
		}

		public override string DefaultFileExtension {
			get { return "csdl"; }
		}

		public override void Convert(Input input, string baseDirectory) {
			EdmxInput edmxInput = input as EdmxInput;
			if(edmxInput == null) {
				base.Convert(input, baseDirectory);
				return;
			}

			WriteXml(edmxInput.CsdlNode, baseDirectory);
		}
	}

}